<?php
class control_news extends core_action{
	
	public $params;
	
	function __construct(){
		$this->params['news'] = 'tabOn';
	}
	
	function index(){
		$news = new core_model_article();
		$this->params['title'] = "新闻公告";
		$this->params['rs'] = $news->select("","*","","order by aid desc")->items;
		$this->render('default/news_index.php', $this->params);
	}
	
	function view(){
		$aid = intval(Qutil::deId($_GET['aid']));
		$news = new core_model_article($aid);
		$this->params['rs'] = $news->getData();
		if(!$this->params['rs']['aid']){
			$this->redirict(Qtpl::createUrl('news', 'index'));
		}
		$this->params['title'] = $this->params['rs']['title'];
		$this->render('default/news_view.php', $this->params);
	}
}